package com.banyuan.domain;

import java.io.Serializable;
import java.util.Objects;

public class ResData implements Serializable {
    /**
     * 处理json返回值
     */

    private Integer code;//200,100001
    private String msg;//错误信息
    private String data;//放数据

    public ResData() {
    }

    public ResData(Integer code, String msg, String data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResData{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data='" + data + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ResData resData = (ResData) o;
        return Objects.equals(code, resData.code) && Objects.equals(msg, resData.msg) && Objects.equals(data, resData.data);
    }

    @Override
    public int hashCode() {
        return Objects.hash(code, msg, data);
    }
}
